/*var character = new charsModel();
character.name = "unnown";
character.room = 1;
character.save();

var user = new usersModel();
user.username = "unnown";
user.password = "az61tl";
user.chars = [{ charID: character._id }];
user.save();*/

exports.getUserModel = function(mongoose) {
	var userSchema = mongoose.Schema({
		username : String,
		password : String,
		curChar : { type: Number, default: 0 },
		banned : { type: Boolean, default: false },
		isAdmin : { type: Boolean, default: false },
		isOnline : { type: Boolean, default: true },
		lastOnline : { type: Date, default: Date.now },
		socketID : String,
		chars: 
		[{ 
			charID : mongoose.Schema.ObjectId
		}]		
	});

	var userModel = mongoose.model('users', userSchema);		
	return userModel;
}

exports.getCharModel = function(mongoose) {
	var characterSchema = mongoose.Schema({
		name : String,
		room : { type: Number, default: 0 },
		classID : mongoose.Schema.ObjectId		
	});

	var characterModel = mongoose.model('character', characterSchema);		
	return characterModel;
}

exports.getClassModel = function(mongoose) {
	var classSchema = mongoose.Schema({
		name : String,
		image : String,
		base_speed : { type: Number, max: 255 },
		base_str : { type: Number, max: 255 },
		base_hp : { type: Number, max: 255 },
		base_mp : { type: Number, max: 255 },
	});

	var classModel = mongoose.model('classes', classSchema);		
	return classModel;
}

exports.getFriendModel = function(mongoose) {
	var friendSchema = mongoose.Schema({
		charID : mongoose.Schema.ObjectId,
		charID : mongoose.Schema.ObjectId
	});

	var friendModel = mongoose.model('friends', friendSchema);		
	return friendModel;
}